/*
 * @Author: jiu yin
 * @Date: 2024-01-09 10:56:33
 * @LastEditTime: 2024-05-21 16:18:38
 * @LastEditors: jiu yin zhen jing
 * @FilePath: \studio-web-admin\src\comment\modal_edit\index.tsx
 * jiu
 */
import { Modal } from "antd";

function Modal_edit(props: any) {
	const { title, width = 600, handleOk, handleCancel = () => {}, isModalOpen = [], okText = "确定", okType = "primary" } = props;

	//取消
	const handleCancel_fn = () => {
		handleCancel();
		isModalOpen[1](false);
	};

	return (
		<Modal
			width={width}
			okText={okText}
			okType={okType}
			title={title}
			open={isModalOpen[0]}
			footer={
				handleOk
					? (_, { OkBtn, CancelBtn }) => (
							<>
								<CancelBtn />
								<OkBtn />
							</>
					  )
					: null
			}
			onOk={handleOk}
			onCancel={handleCancel_fn}>
			{props.children}
		</Modal>
	);
}
export default Modal_edit;
